<template>
	<view>
		<u-navbar :is-back="true" title="设置" 
		 title-bold title-color="#000000" :title-size="34" 
		 :background="{ background: '#eeeeee'}" 
		:border-bottom="false"></u-navbar>
	<!-- 	<scroll-view class="test-border" :scroll-x="false" :scroll-y="true" 
		:style="'height:'+windowHeight+'px;background-color: #eee;'"> -->
		<u-cell-group>
			<!-- <u-cell-item title="账号与安全"  :title-style="titleStyle"></u-cell-item>
			<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
			<u-cell-item title="页面模式"    :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="多语言"  :title-style="titleStyle"></u-cell-item>
			<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
			<u-cell-item title="聊天背景"  :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="发现页管理"  :title-style="titleStyle"></u-cell-item>
			<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
			<u-cell-item title="缓存清理"  :title-style="titleStyle" @click="clearVuex"></u-cell-item>
			<u-cell-item title="关于我们"  :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="版本"  :title-style="titleStyle" :value="vuex_version"></u-cell-item> -->
			<u-cell-item title="账号与安全"  :title-style="titleStyle" @click="toAccountManage()"></u-cell-item>
			<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
			<u-cell-item title="青少年模式"    :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="关怀模式"  :title-style="titleStyle"></u-cell-item>
			<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
			<u-cell-item title="消息通知"  :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="设备"  :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="通用"  :title-style="titleStyle"></u-cell-item>
			<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
			<u-cell-item title="朋友权限"  :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="个人信息与权限"  :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="个人信息收集清单"  :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="第三方信息共享清单"  :title-style="titleStyle"></u-cell-item>
			<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
			<u-cell-item title="插件"  :title-style="titleStyle"></u-cell-item>
			<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
			<u-cell-item title="帮助与反馈"  :title-style="titleStyle"></u-cell-item>
			<u-cell-item title="关于"  :title-style="titleStyle" value="版本 8.0.37" :value-style="titleStyle"></u-cell-item>
		</u-cell-group>
		<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
		<view style="text-align: center;padding: 30rpx;font-size: 32rpx;color: #000000;background-color: #ffffff;">
			<text>切换账号</text>
		</view>
		<u-gap height="20" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>
		<view @click="loginOut" style="text-align: center;padding: 30rpx;font-size: 32rpx;color: #000000;background-color: #ffffff;">
			<text>退出登录</text>
		</view>
		<u-gap height="30" bg-color="#eee" margin-top="1" margin-bottom="1"></u-gap>	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				titleStyle:{
					fontSize:"32rpx",
					color:'#333'
				},
				windowHeight:0,
			};
		},
		created:function(){
			this.windowHeight=this.$u.sys().windowHeight-50;	
		},
		methods:{
			toAccountManage:function(){
				let that=this;	
				this.$u.route("/pages/my/account-safe");
			},
			clearVuex:function(){
				let that=this;
				that.globalUtil.clearStorageVuex(that);
			},
			loginOut:function (){
			  let that=this;
			  this.globalUtil.utilLoading("正在退出登录...",true);
			  //调用service请求后台的接口
			  this.$u.api.sys.loginOut({}).then(res => {
			    uni.hideLoading();
				if(res.code==200){
					let wxLoginParam={'mobile':that.vuex_userInfo.mobile,'avatar':that.vuex_userInfo.avatar};
					uni.setStorageSync("wxLoginParam",JSON.stringify(wxLoginParam));
					this.globalUtil.clearVuex(that);
					setTimeout(function(){
						that.$u.route({
							type:'reLaunch',
							url:"/pages/start/wx-login", //  "/pages/index/login",
							params: {}
						})
					},500);
					return;
				}
				else {
					//密码错误提示
					this.globalUtil.utilAlert(res.message, "none");
					return;
			    }
			  }).catch(res => {
					console.log("res",res);
					this.globalUtil.utilAlert("后台请求失败,请联系管理员!");
			  })
			},
		}
	}
</script>

<style lang="scss" scoped>
	.btn-logout{
	     height: 80rpx;
	     width: 80%;
	     margin: 0rpx 10%;
	     margin-top: 120rpx;
	}
</style>
<style>
	page{
		background-color: #eeeeee;
	}
</style>

